<?php
include("../includes/common.php");
include './head.php';
if($islogin==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
?>

<?php

$count1=$DB->query("SELECT count(*) from pay_order")->fetchColumn();
$count2=$DB->query("SELECT count(*) from pay_user")->fetchColumn();
$count3=$DB->query("SELECT count(*) from panel_user")->fetchColumn();
$count4=$DB->query("SELECT count(*) from pay_cement")->fetchColumn();
$data=unserialize(file_get_contents(SYSTEM_ROOT.'db.txt'));
$mysqlversion=$DB->query("select VERSION()")->fetch();
?>
   <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            <blockquote class="layui-elem-quote">欢迎管理员：
                                <span class="x-red"><?php echo $conf['admin_user']; ?></span>！当前时间:<?php echo date("y-m-d h:i:s",time()) ?>
                            </blockquote>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">数据统计</div>
                        <div class="layui-card-body ">
                            <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">

                            <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>商户数</h3>
                                        <p>
                                            <cite><?php echo $count2?></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>合作者商户数</h3>
                                        <p>
                                            <cite><?php echo $count3?></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>订单数</h3>
                                        <p>
                                            <cite><?php echo $count1?></cite></p>
                                    </a>
                                </li>
                                 <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>文章数据</h3>
                                        <p>
                                            <cite><?php echo $count4?></cite></p>
                                    </a>
                                </li>
                                
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>总计余额</h3>
                                        <p>
                                            <cite><?php echo $data['usermoney']?>元</cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>结算余额</h3>
                                        <p>
                                            <cite><?php echo $data['settlemoney']?>元</cite></p>
                                    </a>
                                </li>
                               
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="layui-card-body ">
                            <table class="layui-table layui-form">
                              <thead>
                                <tr>
                                  <th>订单收入统计</th>
                                  <th>支付宝</th>
                                  <th>微信支付</th>
                                  <th>QQ钱包</th>
                                  <th>财付通</th>
                                  <th>总计</th>    
                              </thead>
                            
                              
                                  <tbody>
                                    <tr>
              <tr><td>今日</td><td><?php echo round($data['order_today']['alipay'],2)?></td><td><?php echo round($data['order_today']['wxpay'],2)?></td><td><?php echo round($data['order_today']['qqpay'],2)?></td><td><?php echo round($data['order_today']['tenpay'],2)?></td><td><?php echo round($data['order_today']['all'],2)?></td></tr>
              <tr><td>昨日</td><td><?php echo round($data['order_lastday']['alipay'],2)?></td><td><?php echo round($data['order_lastday']['wxpay'],2)?></td><td><?php echo round($data['order_lastday']['qqpay'],2)?></td><td><?php echo round($data['order_lastday']['tenpay'],2)?></td><td><?php echo round($data['order_lastday']['all'],2)?></td></tr>                  
                                </tr>
                              </tbody>
                            </table>
                        </div>
              
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">系统信息</div>
                        <div class="layui-card-body ">
                            <table class="layui-table">
                                <tbody>
                                 <tr>
                                 <th>服务器域名</th>
                                        <td><?php echo $_SERVER["HTTP_HOST"];?></td></tr>
              
                                    <tr>
                                        <th>MySQL 版本</th>
                                        <td><?php echo $mysqlversion[0] ?></td></tr>
                                    <tr>
                                        <th>服务器软件：</th>
                                        <td><?php echo $_SERVER['SERVER_SOFTWARE'] ?></td></tr>
                                    <tr>
                                        <th>程序最大运行时间：</th>
                                        <td><?php echo ini_get('max_execution_time') ?>s</td></tr>
                                    <tr>
                                        <th>POST许可：</th>
                                        <td><?php echo ini_get('post_max_size'); ?></td></tr>
                                    <tr>
                                        <th>文件上传许可：</th>
                                        <td><?php echo ini_get('upload_max_filesize'); ?></td></tr>
                                    <tr>
                                        <th>客户端IP</th>
                                        <td><?php echo $_SERVER['REMOTE_ADDR'];?></td></tr>
                                                         <tr>
                                        <th>PHP版本</th>
                                        <td><?php echo phpversion() ?>
            <?php if(ini_get('safe_mode')) { echo '线程安全'; } else { echo '非线程安全'; } ?></td></tr>

                                
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">开发团队</div>
                        <div class="layui-card-body ">
                            <table class="layui-table">
                                <tbody>
                                    <tr>
                                        <th>版权所有</th>
                                        <td>西安市碑林区余生网络信息
                                            <a href="http://www.kuxiangcms.com/" target="_blank">访问官网</a></td>
                                    </tr>
                                    <tr>
                                        <th>开发者</th>
                                        <td>余生(2316803263@qq.com)</td></tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <style id="welcome_style"></style>
                <div class="layui-col-md12">
                    <blockquote class="layui-elem-quote layui-quote-nm">
                    酷享云支付,本系统由<?php echo $conf['copyright']?>提供技术支持。</blockquote></div>
            </div>
        </div>
        </div>